package net.xujialiang.XTestRPA.Repository.Env;

import net.xujialiang.XTestRPA.Entity.Env.XRPAEnvGroup;
import net.xujialiang.XTestRPA.Entity.Env.XRPAEnvTag;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.ArrayList;
import java.util.List;

public interface EnvTagRepository extends CrudRepository<XRPAEnvTag, Integer> {
    Page<XRPAEnvTag> findAllByTtc(String ttc, Pageable pageable);
    @Query("SELECT c FROM XRPAEnvTag c WHERE c.ttc = :ttc and (:tagName is null or c.tagName = :tagName)")
    Page<XRPAEnvTag> findAllByTtcAndTagName(String ttc, String tagName, Pageable pageable);
    List<XRPAEnvTag> findAllByTagIDIn(List<String> tagIDs);
    List<XRPAEnvTag> findAllByTagIDInAndTtc(List<String> tagIDs, String ttc);
}
